

import 'package:bt_tool/basic/bt_language_tool.dart';
import 'package:flutter_demo/common/translate/AppTranslateZh.dart';

import '../translate/AppTranslateEn.dart';
import '../translate/AppTranslateEs.dart';

class AppTranslate {

  static const appSetLanguageChn = "zh-CN";
  static const appSetLanguageEng = "en-US";
  static const appSetLanguageEs = "es-ES";

  static config(){
    BTLanguageTool.share().registerLanguage(AppTranslate.appSetLanguageChn, AppTranslateZh.data());
    BTLanguageTool.share().registerLanguage(AppTranslate.appSetLanguageEng, AppTranslateEn.data());
    BTLanguageTool.share().registerLanguage(AppTranslate.appSetLanguageEs, AppTranslateEs.data());
    BTLanguageTool.share().initLanguage(appSetLanguageEng);
  }


  static String displayLanguageStr(String key){
    if(key == appSetLanguageChn){
      return "中文";
    }

    if(key == appSetLanguageEng){
      return "英文";
    }

    if(key == appSetLanguageEs){
      return "西班牙语";
    }

    return "";
  }

  static String currentDisplayLanguageStr(){
    return displayLanguageStr(BTLanguageTool.share().getCurrentLanguage());
  }

}